import {createWebHashHistory} from "vue-router";
import * as AppRouter from "../../ark/router/app-router.ts";
import appRoutes from "./routes/index.ts";

export default AppRouter.createRouter(
    {
      history: createWebHashHistory(),
      routes: appRoutes,
    },
    {
      afterShowLoading(to) {
        const title = to.meta?.title;
        if (title) {
          document.title = `${title} - XXX系统`;
          return;
        }
        document.title = `XXX系统`;
      },
      allowDefault() {
        return false
        /*const userAccountStore = useAccountStore();
        if (userAccountStore.isLogin) {
          // console.log("menuPermissionStr:"+userAccountStore.menuPermissionStr);
          return false;
        }
        return false;*/
      },
    },
);
